package com.igeek.base.ch0711.Dome4;

import javax.swing.plaf.PanelUI;
import java.util.Random;

/**
 * @Description TODO
 * @Author chenmin
 * @Date 2024/7/11 21:34
 */
public class Person {
    private String name;
    Dog[] dogs=new Dog[3];
    public void buyDog(Market market){
        Random rand = new Random();
        Dog[] marketDogs = market.getDogs();

        for (int i = 0; i < 3; i++) {
            int index = rand.nextInt(10); // 生成0到9之间的随机数
            dogs[i] = marketDogs[index];
        }

    }
    public void show() {
        System.out.println(name + "买到的狗有:");
        for (int i = 0; i < 3; i++) {
            System.out.println(dogs[i].getName());
        }
    }


    }
